<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Bookmark_model extends CI_Model {
	
	public function __construct() {
		parent::__construct();
		$this->load->database();
	}
	
	public function get_bookmarks() {
		$q = $this->db->get('bookmarks');
		// $q = $this->db->query('select * from bookmarks');
		return $q->result();
	}
	
	public function insert($url, $desc) {
		return $this->db->insert('bookmarks', array(
			'url'					=> $url,
			'description'	=> $desc,
		));
	}
		
	public function delete($bid){
		return $this->db->delete('bookmarks', array(
			'id' => $bid,
		));
	}
}